authWithOauth2

inline suspend fun <T : AuthRecord> authWithOauth2(collection: String, provider: String, code: String, codeVerifier: String, redirectUrl: String, expandRelations: ExpandRelations = ExpandRelations(), fields: ShowFields = ShowFields()): AuthResponse<T>

Authenticate with an OAuth2 provider and returns a new auth token and record data. This action usually should be called right after the provider login page redirect. You could also check the OAuth2 web integration example.

Parameters

collection

ID or name of the auth collection

provider

The name of the OAuth2 client provider (eg. "google")

code

The authorization code returned from the initial request.

codeVerifier

The code verifier sent with the initial request as part of the code_challenge.

redirectUrl

The redirect url sent with the initial request.